package cn.com.chec.en.util;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang.StringUtils;

public class ContactUtils {
	public static Map<String, Object> getContactMap() {
		Map<String, Object> map = new HashMap<String, Object>();
		InputStream is = ContactUtils.class.getClassLoader()
				.getResourceAsStream("cn/com/chec/en/conf/contact.properties");
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(is));
			String line = "";
			while ((line = br.readLine()) != null) {
				if ((!StringUtils.isNotBlank(line))
						|| (line.indexOf("=") <= -1))
					continue;
				map.put(line.split("=")[0], line.split("=")[1]);
			}

			br.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return map;
	}
}